﻿using System;
using System.Windows;
using System.Windows.Controls;
using SilverlightOverview.Data;

namespace SilverlightOverview
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            var example = e.NewValue as Example;
            if (example != null)
            {
                MainFrame.Navigate(new Uri("Examples/" + example.Xaml, UriKind.Relative));
            }
        }
    }
}
